package com.caocaog.market.controller;


import com.caocaog.market.annotation.IgnoreAuth;
import com.caocaog.market.service.IGoodsBasicService;
import com.caocaog.market.vo.GoodsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "goodsApi", tags = "API商品信息")
@RequestMapping("/api/goods")
public class ApiGoodsController {
    /*@Autowired
    private IGoodsSortService goodsSortService;*/
    @Autowired
    private IGoodsBasicService goodsBasicService;

    /**
     * to GoodsController.getShopSortList
     */
    /*@IgnoreAuth
    @ApiOperation(value = "门店详情-菜单-分类列表")
    @PostMapping("/getShopSortList")
    public Result getShopSortList(@RequestParam("shopId")String shopId) {

        List<GoodsSort> goodsSortList = goodsSortService.getShopSortList(shopId);

        return Result.OK(goodsSortList);
    }*/

    @Deprecated
    @IgnoreAuth
    @ApiOperation(value = "门店详情-菜单-商品详情",response = GoodsVo.class)
    @GetMapping("/getGoodsInfo")
    public Result getGoodsInfo(@RequestParam("goodsId")String goodsId) {

       GoodsVo vo = goodsBasicService.getGoodsInfo(goodsId);

        return Result.OK(vo);
    }

}
